<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <title>#(APP.name)</title>
    #include("/template/common/include/_css.html")
<style>
    sup {
      font-size: 50%;
      line-height: 0;
      position: relative;
      vertical-align: baseline;
      top: -0.75em;
      background:red;
      border-radius:50%;
      -moz-border-radius:50%; /* Old Firefox */
      margin:0;
      padding-left:3px;
      padding-right:3px;
    }
</style>
</head>
<body>

<!-- layout admin -->
<div class="layui-layout layui-layout-admin"> <!-- 添加skin-1类可手动修改主题为纯白，添加skin-2类可手动修改主题为蓝白 -->
    <!-- header -->
    <div class="layui-header my-header">
        <!--<a href="#(ctxPath)">-->
        <!--<div class="my-header-logo">#(APP.name)</div>-->
        <!--</a>-->
        <!--<a href="javascript:;" layadmin-event="refresh" title="刷新">-->
        <!--<i class="layui-icon layui-icon-refresh-3"></i>-->
        <!--</a>-->

        <a title="#(APP.name)" class="my-header-logo" href="">
            <i class="layui-icon layui-icon-website"></i>
            #(APP.name)
        </a>
        <a href="javascript:" title="侧边伸缩" class="btn-nav my-header-logo">
            <i class="layui-icon layui-icon-shrink-right layui-hide-xs" id="show-left"></i>
        </a>
        <a href="javascript:" id="refresh" title="刷新窗口" class="my-header-logo">
            <i class="layui-icon layui-icon-refresh-3"></i>
        </a>
        <!-- 顶部左侧添加选项卡监听 -->
        <!--<ul class="layui-nav" lay-filter="side-top-left">-->

        <!--</ul>-->


        <!-- 顶部右侧添加选项卡监听 -->
        <ul class="layui-nav my-header-user-nav" lay-filter="side-top-right">

            <li class="layui-nav-item">
                <!-- 如果有新消息，则显示小圆点 -->
                <a id="msg" href="javascript:;" layadmin-event="message" title="" lay-text="">
                    <i class="layui-icon layui-icon-notice"></i><sup id="dot">0</sup>
                </a>
            </li>

            <li class="layui-nav-item">
                <a class="name" href="javascript:;"><i class="layui-icon layui-icon-theme"></i>主题</a>
                <dl class="layui-nav-child">
                    <dd data-skin="0"><a href="javascript:;">默认</a></dd>
                    <dd data-skin="1"><a href="javascript:;">纯白</a></dd>
                    <dd data-skin="2"><a href="javascript:;">蓝白</a></dd>
                </dl>
            </li>
            <!--<img class="layui-circle" src="#(RESOURCE_HOST)/static/img/user.png" alt="logo">-->
            <li class="layui-nav-item">
                <a class="name" href="javascript:;"><i class="layui-icon layui-icon-user"></i>
                    #shiroPrincipal()
                    #(principal)
                    #end
                </a>
                <dl class="layui-nav-child">
                    #shiroHasPermission('/system/user/profile')
                    <dd><a href="javascript:;" href-url="/system/user/profile">个人资料</a></dd>
                    #end
                    #shiroHasPermission('/system/user/changepwd')
                    <dd><a href="javascript:;" href-url="/system/user/changepwd">修改密码</a></dd>
                    #end
                    <dd><a href="#(ctxPath)/logout"><i class="layui-icon">&#x1006;</i>退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <!-- 如果有新消息，则显示小圆点 -->
                <a id="help" href="#(ctxPath)/help" target="_blank" title="" lay-text="">
                    <i class="layui-icon layui-icon-help"></i>
                </a>
            </li>
        </ul>

    </div>
    <!-- side -->
    <div class="layui-side my-side">
        <div class="layui-side-scroll">
            <!-- 左侧主菜单添加选项卡监听 -->
            <ul class="layui-nav layui-nav-tree" lay-filter="side-main">
            </ul>

        </div>
    </div>
    <!-- body -->
    <div class="layui-body my-body">
        <div class="layui-tab layui-tab-card my-tab" lay-filter="card" lay-allowClose="true">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="1"><span><i class="layui-icon">&#xe638;</i>主页</span></li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe id="iframe" src="#(ctxPath)/welcome" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>
    <!-- footer -->
    <div class="layui-footer my-footer">
        <p>
            <a href="#(APP.orgWebsite)" target="_blank">#(APP.org)</a>
            &nbsp;&nbsp;&&nbsp;&nbsp;<a href="javascript:;" target="_blank">#(APP.name)</a>
        </p>
        <p>#(APP.copyRight)</p>
    </div>
</div>


<!-- 右键菜单 -->
<div class="my-dblclick-box none">
    <table class="layui-tab dblclick-tab">
        <tr class="card-refresh">
            <td><i class="layui-icon">&#x1002;</i>刷新当前标签</td>
        </tr>
        <tr class="card-close">
            <td><i class="layui-icon">&#x1006;</i>关闭当前标签</td>
        </tr>
        <tr class="card-close-all">
            <td><i class="layui-icon">&#x1006;</i>关闭所有标签</td>
        </tr>
    </table>
</div>

<script type="text/javascript" src="#(RESOURCE_HOST)/static/js/layui/layui.js"></script>
<script type="text/javascript" src="#(RESOURCE_HOST)/static/js/vip_comm.js"></script>
<script type="text/javascript" src="#(RESOURCE_HOST)/static/js/utils.js"></script>
<script type="text/javascript" src="#(RESOURCE_HOST)/static/js/ztree/jquery-1.4.4.min.js"></script>

<script type="text/javascript">
    layui.use(['layer', 'vip_nav'], function () {

        // 操作对象
        var layer = layui.layer
            , vipNav = layui.vip_nav
            , $ = layui.jquery;

        // 顶部左侧菜单生成 [请求地址,过滤ID,是否展开,携带参数]
        vipNav.top_left('#(ctxPath)/system/res/menuTop', 'side-top-left', false);

        $("#msg").click(function () {
            //window.location.href = '#(ctxPath)/view';
            pop_show('查看通知信息', '#(ctxPath)/view', '1000', '700', function () {
                reloadMessage();
            });
        });


        function reloadMessage() {
            $.post("#(ctxPath)/message", function (res) {
                /*if ($("#dot").hasClass("layui-badge")) {
                    $("#dot").removeClass("layui-badge");
                    $("#dot").html("");
                }*/
                if (res != null) {
                    if (res['size']> 0){
                        /*$("#dot").addClass("layui-badge");*/
                        $("#dot").html(res['size']);
                    }else{
                        $("#dot").addClass("layui-hide");
                    }
                } else {
                    layer.msg("数据异常");
                }
            })
        }

        reloadMessage();
        setInterval(function () {
            reloadMessage();
        }, 1000000);

        $(window).resize(function () {
            var window_width = $(window).width();
            if (window_width < 1020) {
                $('#show-left').addClass("layui-hide");
            } else {
                $('#show-left').removeClass("layui-hide");
            }
        });
        layer.tips('帮助', '#help', {
            tips: 3,
            time: 3000
        });

    });

    $("#refresh").click(function () {
        refresh();
    });


    function refresh() {
        var ifr = $(".layui-tab-item.layui-show").children("iframe");
        ifr.attr('src', ifr.attr('src'));
    }
</script>
</body>
</html>